import request from '@/utils/request'

// 新增会员
export const addMemberService = (memberAddDTO) => {
  return request.post('/admin/member/add', memberAddDTO)
}

// 会员分页查询
export const memberPageQueryService = (memberPageQueryDTO) => {
  return request.get('/admin/member/page', { params: memberPageQueryDTO })
}

// 根据会员id查询会员信息
export const getMemberByIdService = (id) => {
  return request.get(`/admin/member/${id}`)
}

// 修改会员信息
export const updateMemberService = (memberUpdateDTO) => {
  return request.put('/admin/member', memberUpdateDTO)
}

// 删除会员
export const deleteMemberService = (id) => {
  return request.delete(`/admin/member/${id}`)
}

// 会员余额充值
export const rechargeMemberBalanceService = (amount, id) => {
  return request.post(`/admin/member/recharge/${amount}`, null, { params: { id } })
}
